function curry(fn) {
    return function curryFn(...args) {
        if (args.length == fn.length) {
            return fn(...args)
        }else {
            return function(){
                return curryFn(...args.concat(Array.from(arguments)))
            }
        }
    }

}

function compose(...args) {
    return function (val) {
        return args.reduce((pre, next) => {
            return next(pre)
        }, val)
    }
}